package com.xxwu.mybatis.service;

import com.xxwu.mybatis.mapper.UserInfoMapper;
import com.xxwu.mybatis.model.userInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("/UserService")
public class UserService {
    @Autowired
    private UserInfoMapper userInfoMapper;

    @RequestMapping("/getData")
    public List<userInfo> getData() {
        return userInfoMapper.queryAllUser();
    }
    @RequestMapping("/getDataByIdAndAge")
    public userInfo getDataByIdAndAge(int id, int age) {
        return userInfoMapper.queryUserByIdAndAge(1,18);
    }
}
